/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'ap-northeast-1' = 'agency.aliyuncs.com',
    'ap-northeast-2-pop' = 'agency.aliyuncs.com',
    'ap-south-1' = 'agency.aliyuncs.com',
    'ap-southeast-2' = 'agency.aliyuncs.com',
    'ap-southeast-3' = 'agency.aliyuncs.com',
    'ap-southeast-5' = 'agency.aliyuncs.com',
    'cn-beijing' = 'agency.aliyuncs.com',
    'cn-beijing-finance-1' = 'agency.aliyuncs.com',
    'cn-beijing-finance-pop' = 'agency.aliyuncs.com',
    'cn-beijing-gov-1' = 'agency.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'agency.aliyuncs.com',
    'cn-chengdu' = 'agency.aliyuncs.com',
    'cn-edge-1' = 'agency.aliyuncs.com',
    'cn-fujian' = 'agency.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'agency.aliyuncs.com',
    'cn-hangzhou' = 'agency.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'agency.aliyuncs.com',
    'cn-hangzhou-finance' = 'agency.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'agency.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'agency.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'agency.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'agency.aliyuncs.com',
    'cn-hangzhou-test-306' = 'agency.aliyuncs.com',
    'cn-hongkong' = 'agency.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'agency.aliyuncs.com',
    'cn-huhehaote' = 'agency.aliyuncs.com',
    'cn-huhehaote-nebula-1' = 'agency.aliyuncs.com',
    'cn-north-2-gov-1' = 'agency.aliyuncs.com',
    'cn-qingdao' = 'agency.aliyuncs.com',
    'cn-qingdao-nebula' = 'agency.aliyuncs.com',
    'cn-shanghai' = 'agency.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'agency.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'agency.aliyuncs.com',
    'cn-shanghai-finance-1' = 'agency.aliyuncs.com',
    'cn-shanghai-inner' = 'agency.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'agency.aliyuncs.com',
    'cn-shenzhen' = 'agency.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'agency.aliyuncs.com',
    'cn-shenzhen-inner' = 'agency.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'agency.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'agency.aliyuncs.com',
    'cn-wuhan' = 'agency.aliyuncs.com',
    'cn-wulanchabu' = 'agency.aliyuncs.com',
    'cn-yushanfang' = 'agency.aliyuncs.com',
    'cn-zhangbei' = 'agency.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'agency.aliyuncs.com',
    'cn-zhangjiakou' = 'agency.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'agency.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'agency.aliyuncs.com',
    'eu-central-1' = 'agency.aliyuncs.com',
    'eu-west-1' = 'agency.aliyuncs.com',
    'eu-west-1-oxs' = 'agency.aliyuncs.com',
    'me-east-1' = 'agency.aliyuncs.com',
    'rus-west-1-pop' = 'agency.aliyuncs.com',
    'us-east-1' = 'agency.aliyuncs.com',
    'us-west-1' = 'agency.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('agency', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CancelCouponRequest {
  couponId?: long(name='CouponId', description='This parameter is required.', example='501001340370350'),
}

model CancelCouponResponseBody = {
  code?: string(name='Code', example='200'),
  data?: boolean(name='Data', example='true'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', example='true'),
}

model CancelCouponResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelCouponResponseBody(name='body'),
}

/**
 * @summary 作废优惠券
 *
 * @param request CancelCouponRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelCouponResponse
 */
async function cancelCouponWithOptions(request: CancelCouponRequest, runtime: Util.RuntimeOptions): CancelCouponResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.couponId)) {
    query['CouponId'] = request.couponId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelCoupon',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 作废优惠券
 *
 * @param request CancelCouponRequest
 * @return CancelCouponResponse
 */
async function cancelCoupon(request: CancelCouponRequest): CancelCouponResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelCouponWithOptions(request, runtime);
}

model CancelSubscriptionBillRequest {
  subscribeType?: string(name='SubscribeType', description='The type of the bill to which you want to cancel the subscription. Valid values: PartnerBillingItemDetailForBillingPeriod, PartnerBillingItemDetailMonthly, PartnerInstanceDetailForBillingPeriod, and PartnerInstanceDetailMonthly.

This parameter is required.', example='PartnerBillingItemDetailForBillingPeriod'),
}

model CancelSubscriptionBillResponseBody = {
  code?: string(name='Code', description='The HTTP status code that is returned.', example='200'),
  data?: boolean(name='Data', description='The data that is returned.', example='true'),
  message?: string(name='Message', description='The message that is returned.', example='Successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='210e876f16704666020714468dab35'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model CancelSubscriptionBillResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelSubscriptionBillResponseBody(name='body'),
}

/**
 * @summary Cancels the subscription to multi-level bills as an Alibaba Cloud eco-partner.
 *
 * @description Make sure that you are a distributor of the Alibaba Cloud international ecosystem.
 * You can call this operation to cancel the subscription to only one type of bill at a time.
 * After the subscription to a type of bill is canceled, bills of this type are no longer pushed to the specified Object Storage Service (OSS) bucket.
 * **This topic is published only on the international site (alibabacloud.com).
 *
 * @param request CancelSubscriptionBillRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelSubscriptionBillResponse
 */
async function cancelSubscriptionBillWithOptions(request: CancelSubscriptionBillRequest, runtime: Util.RuntimeOptions): CancelSubscriptionBillResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.subscribeType)) {
    query['SubscribeType'] = request.subscribeType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelSubscriptionBill',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Cancels the subscription to multi-level bills as an Alibaba Cloud eco-partner.
 *
 * @description Make sure that you are a distributor of the Alibaba Cloud international ecosystem.
 * You can call this operation to cancel the subscription to only one type of bill at a time.
 * After the subscription to a type of bill is canceled, bills of this type are no longer pushed to the specified Object Storage Service (OSS) bucket.
 * **This topic is published only on the international site (alibabacloud.com).
 *
 * @param request CancelSubscriptionBillRequest
 * @return CancelSubscriptionBillResponse
 */
async function cancelSubscriptionBill(request: CancelSubscriptionBillRequest): CancelSubscriptionBillResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelSubscriptionBillWithOptions(request, runtime);
}

model CouponApprovalStatusListRequest {
  pageNo?: int32(name='PageNo', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  templateId?: string(name='TemplateId', example='5093156'),
  templateName?: string(name='TemplateName'),
  templateStatus?: string(name='TemplateStatus', example='2'),
}

model CouponApprovalStatusListResponseBody = {
  code?: string(name='Code', example='200'),
  data?: [ 
    {
      issuerAccount?: string(name='IssuerAccount', example='test@test.aliyunid.com'),
      issuerUid?: string(name='IssuerUid', example='5432738203821334'),
      note?: string(name='Note'),
      templateId?: string(name='TemplateId', example='S00000101-100040'),
      templateName?: string(name='TemplateName'),
      templateStatus?: long(name='TemplateStatus', example='2'),
      timeOfRequest?: string(name='TimeOfRequest', example='2024-02-02 09:46:59'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  total?: int32(name='Total', example='10'),
}

model CouponApprovalStatusListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CouponApprovalStatusListResponseBody(name='body'),
}

/**
 * @summary 优惠券审批状态列表
 *
 * @param request CouponApprovalStatusListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CouponApprovalStatusListResponse
 */
async function couponApprovalStatusListWithOptions(request: CouponApprovalStatusListRequest, runtime: Util.RuntimeOptions): CouponApprovalStatusListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.templateStatus)) {
    query['TemplateStatus'] = request.templateStatus;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CouponApprovalStatusList',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 优惠券审批状态列表
 *
 * @param request CouponApprovalStatusListRequest
 * @return CouponApprovalStatusListResponse
 */
async function couponApprovalStatusList(request: CouponApprovalStatusListRequest): CouponApprovalStatusListResponse {
  var runtime = new Util.RuntimeOptions{};
  return couponApprovalStatusListWithOptions(request, runtime);
}

model CreateCouponTemplateRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='This parameter is required.', example='zh-CN'),
  applicableProducts?: string(name='ApplicableProducts', description='This parameter is required.', example='All Products'),
  costBearer?: string(name='CostBearer', description='This parameter is required.', example='Partner'),
  couponDescription?: string(name='CouponDescription'),
  expireddate?: string(name='Expireddate', example='2024-08-26'),
  limitPerPerson?: string(name='LimitPerPerson', description='This parameter is required.', example='Unlimited'),
  productType?: [ string ](name='ProductType'),
  purchaseType?: string(name='PurchaseType', example='ALL'),
  reasonForApplication?: string(name='ReasonForApplication', description='This parameter is required.'),
  templateName?: string(name='TemplateName', description='This parameter is required.'),
  vailddate?: string(name='Vailddate', example='2024-08-26'),
  vaildperioddays?: string(name='Vaildperioddays', example='1'),
  validUntil?: string(name='ValidUntil', description='This parameter is required.', example='Validity Duration'),
  value?: string(name='Value', description='This parameter is required.', example='1'),
}

model CreateCouponTemplateShrinkRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='This parameter is required.', example='zh-CN'),
  applicableProducts?: string(name='ApplicableProducts', description='This parameter is required.', example='All Products'),
  costBearer?: string(name='CostBearer', description='This parameter is required.', example='Partner'),
  couponDescription?: string(name='CouponDescription'),
  expireddate?: string(name='Expireddate', example='2024-08-26'),
  limitPerPerson?: string(name='LimitPerPerson', description='This parameter is required.', example='Unlimited'),
  productTypeShrink?: string(name='ProductType'),
  purchaseType?: string(name='PurchaseType', example='ALL'),
  reasonForApplication?: string(name='ReasonForApplication', description='This parameter is required.'),
  templateName?: string(name='TemplateName', description='This parameter is required.'),
  vailddate?: string(name='Vailddate', example='2024-08-26'),
  vaildperioddays?: string(name='Vaildperioddays', example='1'),
  validUntil?: string(name='ValidUntil', description='This parameter is required.', example='Validity Duration'),
  value?: string(name='Value', description='This parameter is required.', example='1'),
}

model CreateCouponTemplateResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    applicableProducts?: string(name='ApplicableProducts', example='Custom'),
    costBearer?: string(name='CostBearer', example='Partner'),
    couponTemplateID?: long(name='CouponTemplateID', example='111111'),
    createTime?: string(name='CreateTime', example='2024-04-02 16:15:31'),
    expireddate?: string(name='Expireddate', example='2024-01-01'),
    productType?: [ string ](name='ProductType'),
    status?: string(name='Status', example='APPROVED'),
    templateName?: string(name='TemplateName'),
    vailddate?: string(name='Vailddate', example='2024-01-01'),
    vaildperioddays?: string(name='Vaildperioddays', example='1'),
    validUntil?: string(name='ValidUntil', example='Validity Duration'),
    value?: string(name='Value', example='1'),
  }(name='Data'),
  message?: string(name='Message', example='200'),
  requestId?: string(name='RequestId', description='Id of the request', example='2103a30617045934095083027d88c5'),
  success?: boolean(name='Success', example='true'),
}

model CreateCouponTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCouponTemplateResponseBody(name='body'),
}

/**
 * @summary 创建优惠券模板
 *
 * @param tmpReq CreateCouponTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCouponTemplateResponse
 */
async function createCouponTemplateWithOptions(tmpReq: CreateCouponTemplateRequest, runtime: Util.RuntimeOptions): CreateCouponTemplateResponse {
  Util.validateModel(tmpReq);
  var request = new CreateCouponTemplateShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.productType)) {
    request.productTypeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.productType, 'ProductType', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.applicableProducts)) {
    query['ApplicableProducts'] = request.applicableProducts;
  }
  if (!Util.isUnset(request.costBearer)) {
    query['CostBearer'] = request.costBearer;
  }
  if (!Util.isUnset(request.couponDescription)) {
    query['CouponDescription'] = request.couponDescription;
  }
  if (!Util.isUnset(request.expireddate)) {
    query['Expireddate'] = request.expireddate;
  }
  if (!Util.isUnset(request.limitPerPerson)) {
    query['LimitPerPerson'] = request.limitPerPerson;
  }
  if (!Util.isUnset(request.productTypeShrink)) {
    query['ProductType'] = request.productTypeShrink;
  }
  if (!Util.isUnset(request.purchaseType)) {
    query['PurchaseType'] = request.purchaseType;
  }
  if (!Util.isUnset(request.reasonForApplication)) {
    query['ReasonForApplication'] = request.reasonForApplication;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.vailddate)) {
    query['Vailddate'] = request.vailddate;
  }
  if (!Util.isUnset(request.vaildperioddays)) {
    query['Vaildperioddays'] = request.vaildperioddays;
  }
  if (!Util.isUnset(request.validUntil)) {
    query['ValidUntil'] = request.validUntil;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCouponTemplate',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建优惠券模板
 *
 * @param request CreateCouponTemplateRequest
 * @return CreateCouponTemplateResponse
 */
async function createCouponTemplate(request: CreateCouponTemplateRequest): CreateCouponTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCouponTemplateWithOptions(request, runtime);
}

model CreateCustomerRequest {
  customerName?: string(name='CustomerName', description='Customer\\\\"s name.

This parameter is required.', example='DoorBell Marketing'),
  customerSource?: string(name='CustomerSource', description='The source/channel that allow client to connected with us. Please enumerate with Customer Source.

This parameter is required.', example='website'),
  customerSubTrade?: string(name='CustomerSubTrade', description='The sub-industry that Customer\\\\"s business belongs to. Please enumerate with Customer Trade.', example='0101'),
  customerTrade?: string(name='CustomerTrade', description='The industry that Customer\\\\"s business belongs to. Please enumerate with Customer Trade.

This parameter is required.', example='01'),
  nation?: string(name='Nation', description='The region that Customer choose to launch the Cloud Service. Please use ListCountries to confirm the valid region list for current UID.

This parameter is required.', example='AR'),
}

model CreateCustomerResponseBody = {
  code?: string(name='Code', description='Code indicating whether the call was successful.', example='200'),
  data?: boolean(name='Data', description='Data indicating whether a customer was successfully created. If it\\\\"s "true", the Message contains CID.', example='true'),
  message?: string(name='Message', description='Massage indicating whether the call was successful.', example='12345'),
  requestId?: string(name='RequestId', description='Request ID, Alibaba Cloud will track errors with this.', example='A9B725C7-3DBD-576B-AC91-F6F22AB99A77'),
  success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call it self was successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model CreateCustomerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCustomerResponseBody(name='body'),
}

/**
 * @summary This function is designed for create a customer who is to be invited.
 *
 * @param request CreateCustomerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCustomerResponse
 */
async function createCustomerWithOptions(request: CreateCustomerRequest, runtime: Util.RuntimeOptions): CreateCustomerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.customerName)) {
    query['CustomerName'] = request.customerName;
  }
  if (!Util.isUnset(request.customerSource)) {
    query['CustomerSource'] = request.customerSource;
  }
  if (!Util.isUnset(request.customerSubTrade)) {
    query['CustomerSubTrade'] = request.customerSubTrade;
  }
  if (!Util.isUnset(request.customerTrade)) {
    query['CustomerTrade'] = request.customerTrade;
  }
  if (!Util.isUnset(request.nation)) {
    query['Nation'] = request.nation;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCustomer',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary This function is designed for create a customer who is to be invited.
 *
 * @param request CreateCustomerRequest
 * @return CreateCustomerResponse
 */
async function createCustomer(request: CreateCustomerRequest): CreateCustomerResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCustomerWithOptions(request, runtime);
}

model CustomerQuotaRecordListRequest {
  endDate?: string(name='EndDate', description='End Date Format: yyyy-MM-dd

This parameter is required.', example='2023-09-24'),
  endUserPk?: long(name='EndUserPk', description='Customer UID

This parameter is required.', example='5113766248601929'),
  language?: string(name='Language', description='Multilingual Parameters, the default language is English.</br>
en: English</br>
zh: Chinese</br>
ja: Japanese </br>', example='en'),
  operationType?: string(name='OperationType', description='Operation Type Enum</br>
all All types</br>
quota_create Create quota</br>
quota_amount_adjust Adjust the amount of quota</br>

This parameter is required.', example='all'),
  pageNo?: int32(name='PageNo', description='Pagination, current page number, starting from 1.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='Pagination, record number on each page. Maximum 100.

This parameter is required.', example='10'),
  startDate?: string(name='StartDate', description='Start Date Format: yyyy-MM-dd

This parameter is required.', example='2023-01-02'),
}

model CustomerQuotaRecordListResponseBody = {
  code?: string(name='Code', description='Status code of returning result, 200 means success.', example='200'),
  data?: [ 
    {
      operationSubmitType?: string(name='OperationSubmitType', description='The way to submit the quota adjustment operation. API/ACPN', example='ACPN'),
      operationTime?: string(name='OperationTime', description='The time of submit the quota adjustment operation.', example='2023-12-15 10:34:36 UTC+8'),
      operationTypeCode?: string(name='OperationTypeCode', description='Operation Type Enum</br>
all All types</br>
quota_create Create quota</br>
quota_amount_adjust Adjust the amount of quota</br>', example='quota_amount_adjust'),
      operationTypeDesc?: string(name='OperationTypeDesc', description='The description of submitted quota adjustment operation.', example='Quota Adjustment'),
      operationUid?: string(name='OperationUid', description='The UID of operator(Partner\\\\"s UID).', example='5113766248601929'),
      updateAfterAmount?: string(name='UpdateAfterAmount', description='Updated quota amount', example='121.00'),
      updateAmount?: string(name='UpdateAmount', description='The difference amount between updated quota and original quota.', example='-100.00'),
      updateBeforeAmount?: string(name='UpdateBeforeAmount', description='Original quota amount', example='221.00'),
    }
  ](name='Data', description='Listed data of returning result'),
  msg?: string(name='Msg', description='Description of returning data', example='SUCCESS'),
  pageNo?: int32(name='PageNo', description='Current page number', example='1'),
  pageSize?: int32(name='PageSize', description='Record number on each page', example='10'),
  requestId?: string(name='RequestId', description='ID of request', example='2103a0ae16849855284594613d874e'),
  total?: int32(name='Total', description='Total volume', example='10'),
}

model CustomerQuotaRecordListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CustomerQuotaRecordListResponseBody(name='body'),
}

/**
 * @summary Query quota adjustment list of Distribution Customer from International Site. Not available on Domestic Site.
 *
 * @param request CustomerQuotaRecordListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CustomerQuotaRecordListResponse
 */
async function customerQuotaRecordListWithOptions(request: CustomerQuotaRecordListRequest, runtime: Util.RuntimeOptions): CustomerQuotaRecordListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CustomerQuotaRecordList',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Query quota adjustment list of Distribution Customer from International Site. Not available on Domestic Site.
 *
 * @param request CustomerQuotaRecordListRequest
 * @return CustomerQuotaRecordListResponse
 */
async function customerQuotaRecordList(request: CustomerQuotaRecordListRequest): CustomerQuotaRecordListResponse {
  var runtime = new Util.RuntimeOptions{};
  return customerQuotaRecordListWithOptions(request, runtime);
}

model DeductOutstandingBalanceRequest {
  deductAmount?: string(name='DeductAmount', description='The Deducted Credit to be offset.

This parameter is required.', example='300'),
  uid?: long(name='Uid', description='Account UID of Distribution Customer.

This parameter is required.', example='1133166938931507'),
}

model DeductOutstandingBalanceResponseBody = {
  code?: string(name='Code', description='Result Code. Value Range:
- 200 OK
- 1109 System Error', example='200'),
  message?: string(name='Message', description='Same as Code Parameter Value.', example='200'),
  requestId?: string(name='RequestId', description='Request ID, the unique request identifier generated by Alibaba Cloud.', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model DeductOutstandingBalanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeductOutstandingBalanceResponseBody(name='body'),
}

/**
 * @summary This API is used to offset the Deducted Credit of a Distribution Customer. For example, if the current Deducted Credit is 500 and the Available Credit is 1000, by offsetting 300, the Deducted Credit will then become 200, and the Available Credit becomes 1300.
 *
 * @description Note that sometimes you may find that the customer\\"s Used Credit is negative. This indicates that there is no need to restore the Used Credit, and its ready for customer\\"s usage. This phenomenon occurs because a refund is generated while the customer\\"s credit is full, thereby triggered additional increasing on the customer\\"s credit.
 * For example, if the customer\\"s maximum Available Credit is 1000 with no usage, and a refund of 300 occurs, the Used Credit will become -300.
 *
 * @param request DeductOutstandingBalanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeductOutstandingBalanceResponse
 */
async function deductOutstandingBalanceWithOptions(request: DeductOutstandingBalanceRequest, runtime: Util.RuntimeOptions): DeductOutstandingBalanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deductAmount)) {
    query['DeductAmount'] = request.deductAmount;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeductOutstandingBalance',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary This API is used to offset the Deducted Credit of a Distribution Customer. For example, if the current Deducted Credit is 500 and the Available Credit is 1000, by offsetting 300, the Deducted Credit will then become 200, and the Available Credit becomes 1300.
 *
 * @description Note that sometimes you may find that the customer\\"s Used Credit is negative. This indicates that there is no need to restore the Used Credit, and its ready for customer\\"s usage. This phenomenon occurs because a refund is generated while the customer\\"s credit is full, thereby triggered additional increasing on the customer\\"s credit.
 * For example, if the customer\\"s maximum Available Credit is 1000 with no usage, and a refund of 300 occurs, the Used Credit will become -300.
 *
 * @param request DeductOutstandingBalanceRequest
 * @return DeductOutstandingBalanceResponse
 */
async function deductOutstandingBalance(request: DeductOutstandingBalanceRequest): DeductOutstandingBalanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deductOutstandingBalanceWithOptions(request, runtime);
}

model DeleteCouponTemplateRequest {
  templateId?: long(name='TemplateId', description='This parameter is required.', example='6558410265670417297'),
}

model DeleteCouponTemplateResponseBody = {
  code?: string(name='Code', example='200'),
  data?: boolean(name='Data', example='true'),
  message?: string(name='Message', example='200'),
  requestId?: string(name='RequestId', example='A747A00F-E096-5244-88B3-3E474BAE3AE4'),
  success?: boolean(name='Success', example='true'),
}

model DeleteCouponTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCouponTemplateResponseBody(name='body'),
}

/**
 * @summary 作废优惠券模板
 *
 * @param request DeleteCouponTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCouponTemplateResponse
 */
async function deleteCouponTemplateWithOptions(request: DeleteCouponTemplateRequest, runtime: Util.RuntimeOptions): DeleteCouponTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCouponTemplate',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 作废优惠券模板
 *
 * @param request DeleteCouponTemplateRequest
 * @return DeleteCouponTemplateResponse
 */
async function deleteCouponTemplate(request: DeleteCouponTemplateRequest): DeleteCouponTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCouponTemplateWithOptions(request, runtime);
}

model EditEndUserStatusRequest {
  creditStatus?: string(name='CreditStatus', description='Shutdown Status</br>

- postPayFreeze, the account have been blocked</br>

- postPayThaw, the account have been unlocked</br>', example='postPayFreeze'),
  uid?: long(name='Uid', description='UID', example='1792155717328010'),
}

model EditEndUserStatusResponseBody = {
  code?: string(name='Code', description='Status Code</br>', example='200'),
  data?: string(name='Data', description='Success or not</br>', example='true'),
  message?: string(name='Message', description='Message</br>', example='success'),
  msg?: string(name='Msg', description='Message</br>', example='success'),
  requestId?: string(name='RequestId', description='Request ID</br>', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
}

model EditEndUserStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EditEndUserStatusResponseBody(name='body'),
}

/**
 * @summary Set the after-shutdown instance status for post-pay End Users as a Reseller.
 *
 * @description The caller should be the Partner as identified in the Alibaba Cloud distribution model. </br>
 * **This content is only published on the international site. **
 *
 * @param request EditEndUserStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EditEndUserStatusResponse
 */
async function editEndUserStatusWithOptions(request: EditEndUserStatusRequest, runtime: Util.RuntimeOptions): EditEndUserStatusResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EditEndUserStatus',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Set the after-shutdown instance status for post-pay End Users as a Reseller.
 *
 * @description The caller should be the Partner as identified in the Alibaba Cloud distribution model. </br>
 * **This content is only published on the international site. **
 *
 * @param request EditEndUserStatusRequest
 * @return EditEndUserStatusResponse
 */
async function editEndUserStatus(request: EditEndUserStatusRequest): EditEndUserStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return editEndUserStatusWithOptions(request, runtime);
}

model EditNewBuyStatusRequest {
  newBuyStatus?: string(name='NewBuyStatus', description='New Purchase Status</br>

- cancelBan: Cancel the restriction for New Purchase request</br>

- ban: ban the New Purchase request</br>', example='cancelBan'),
  uid?: long(name='Uid', description='Customer UID', example='1133166938931507'),
}

model EditNewBuyStatusResponseBody = {
  code?: string(name='Code', description='Status Code</br>', example='200'),
  data?: string(name='Data', description='Success or not</br>', example='true'),
  message?: string(name='Message', description='Message</br>', example='success'),
  msg?: string(name='Msg', description='Message</br>', example='success'),
  requestId?: string(name='RequestId', description='Request ID</br>', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
}

model EditNewBuyStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EditNewBuyStatusResponseBody(name='body'),
}

/**
 * @summary Set the New Buy status for Sub-Customer as a Partner.
 *
 * @description The caller should be the Partner as identified in the Alibaba Cloud distribution model. </br>
 * **This content is only published on the international site. **
 *
 * @param request EditNewBuyStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EditNewBuyStatusResponse
 */
async function editNewBuyStatusWithOptions(request: EditNewBuyStatusRequest, runtime: Util.RuntimeOptions): EditNewBuyStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.newBuyStatus)) {
    query['NewBuyStatus'] = request.newBuyStatus;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EditNewBuyStatus',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Set the New Buy status for Sub-Customer as a Partner.
 *
 * @description The caller should be the Partner as identified in the Alibaba Cloud distribution model. </br>
 * **This content is only published on the international site. **
 *
 * @param request EditNewBuyStatusRequest
 * @return EditNewBuyStatusResponse
 */
async function editNewBuyStatus(request: EditNewBuyStatusRequest): EditNewBuyStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return editNewBuyStatusWithOptions(request, runtime);
}

model EditZeroCreditShutdownRequest {
  shutdownPolicy?: string(name='ShutdownPolicy', description='UID', example='Shutdown Policy</br>

- immediatelyStop, The instances of the specified End User\\\\"s account will be shutdown immediately once EU triggered the Shutdown Policy.</br>

- delayStop, The instances of the specified End User\\\\"s account will be shutdown later, even EU have triggered the Shutdown Policy.</br>

- noStop, The instances of the specified End User\\\\"s account will not be shutdown, after EU have triggered the Shutdown Policy.</br>'),
  uid?: long(name='Uid', description='No Change History', example='1263644979775567'),
}

model EditZeroCreditShutdownResponseBody = {
  code?: string(name='Code', description='Success or not</br>', example='200'),
  data?: string(name='Data', description='Request ID</br>', example='true'),
  message?: string(name='Message', description='Message</br>', example='Message</br>'),
  msg?: string(name='Msg', description='NO_STOP', example='SUCCESS'),
  requestId?: string(name='RequestId', description='success', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
}

model EditZeroCreditShutdownResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EditZeroCreditShutdownResponseBody(name='body'),
}

/**
 * @summary Modify the End User\\"s Shutdown Policy as a Reseller.
 *
 * @description The caller should be the Partner as identified in the Alibaba Cloud distribution model. </br>
 * **This content is only published on the international site. **
 *
 * @param request EditZeroCreditShutdownRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EditZeroCreditShutdownResponse
 */
async function editZeroCreditShutdownWithOptions(request: EditZeroCreditShutdownRequest, runtime: Util.RuntimeOptions): EditZeroCreditShutdownResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.shutdownPolicy)) {
    query['ShutdownPolicy'] = request.shutdownPolicy;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EditZeroCreditShutdown',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modify the End User\\"s Shutdown Policy as a Reseller.
 *
 * @description The caller should be the Partner as identified in the Alibaba Cloud distribution model. </br>
 * **This content is only published on the international site. **
 *
 * @param request EditZeroCreditShutdownRequest
 * @return EditZeroCreditShutdownResponse
 */
async function editZeroCreditShutdown(request: EditZeroCreditShutdownRequest): EditZeroCreditShutdownResponse {
  var runtime = new Util.RuntimeOptions{};
  return editZeroCreditShutdownWithOptions(request, runtime);
}

model ExportCustomerQuotaRecordRequest {
  endDate?: string(name='EndDate', description='End Date Format:  yyyy-MM-dd

This parameter is required.', example='2023-12-24'),
  endUserPk?: long(name='EndUserPk', description='Customer UID

This parameter is required.', example='5113766248601929'),
  language?: string(name='Language', description='Multilingual Parameters, the default language is English.</br>
en: English</br>
zh: Chinese</br>
ja: Japanese </br>', example='en'),
  operationType?: string(name='OperationType', description='Operation Type Enum</br>
all All types</br>
quota_create Create quota</br>
quota_amount_adjust Adjust the amount of quota</br>

This parameter is required.', example='all'),
  startDate?: string(name='StartDate', description='Start Date Format:  yyyy-MM-dd

This parameter is required.', example='2023-11-10'),
}

model ExportCustomerQuotaRecordResponseBody = {
  code?: string(name='Code', description='Code', example='200'),
  data?: {
    cost?: int32(name='Cost', description='Estimated duration, in minutes.', example='1'),
    id?: long(name='Id', description='ID of Export task', example='1231'),
  }(name='Data', description='Data'),
  msg?: string(name='Msg', description='Description', example='SUCCESS'),
  requestId?: string(name='RequestId', description='ID of the Request', example='210bc4b416874189683843905d9f9a'),
}

model ExportCustomerQuotaRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportCustomerQuotaRecordResponseBody(name='body'),
}

/**
 * @summary Export quota amount adjustment history as a Distribution Customer from International Site. Only available on International Site.
 *
 * @description Caller must be a Partner from International Site, either Distribution or Reseller will do.
 *
 * @param request ExportCustomerQuotaRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportCustomerQuotaRecordResponse
 */
async function exportCustomerQuotaRecordWithOptions(request: ExportCustomerQuotaRecordRequest, runtime: Util.RuntimeOptions): ExportCustomerQuotaRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.endUserPk)) {
    query['EndUserPk'] = request.endUserPk;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.operationType)) {
    query['OperationType'] = request.operationType;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExportCustomerQuotaRecord',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Export quota amount adjustment history as a Distribution Customer from International Site. Only available on International Site.
 *
 * @description Caller must be a Partner from International Site, either Distribution or Reseller will do.
 *
 * @param request ExportCustomerQuotaRecordRequest
 * @return ExportCustomerQuotaRecordResponse
 */
async function exportCustomerQuotaRecord(request: ExportCustomerQuotaRecordRequest): ExportCustomerQuotaRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return exportCustomerQuotaRecordWithOptions(request, runtime);
}

model GetAccountInfoRequest {
  currentPage?: int32(name='CurrentPage', description='Pagination, current page.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='Pagination, record number on each page, maximum 20.

This parameter is required.', example='10'),
  uid?: long(name='Uid', description='Account UID of Distribution Customer. This parameter and the UserType parameter must have one filled. If this parameter is empty, then check all Distribution Customer accounts of the selected UserType.', example='1215848086704806'),
  userType?: string(name='UserType', description='Distribution Customer\\\\"s Account Type:
- 1 End User
- 2 Enterprise
- 3 T2 Partner', example='1'),
}

model GetAccountInfoResponseBody = {
  accountInfoList?: {
    accountInfo?: [ 
    {
      accountNickname?: string(name='AccountNickname', description='The name of Sub Account.
- Enterprise Customer: Name of Company
- T2 Reseller: Name of Partner', example='XXX Technology LTD.'),
      aliyunId?: string(name='AliyunId', description='Alibaba Cloud Login name of Distribution Customer.', example='1234@qq.com'),
      associationSuccessTime?: string(name='AssociationSuccessTime', description='The time that Distribution Customer successfully associated with Distributor.', example='2021-01-01'),
      cid?: long(name='Cid', description='Account CID of Distribution Customer.', example='61479572'),
      customerAccountType?: int32(name='CustomerAccountType', description='Type of customer\\\\"s account, 0 Individual, 1 Enterprise', example='1'),
      customerBd?: string(name='CustomerBd', description='Customer\\\\"s Sales Manager', example='Tommy'),
      customerEnterpriseCertified?: int32(name='CustomerEnterpriseCertified', description='Whether the customer has completed Enterprise Real-name Authentication, 0 No, 1 Yes', example='1'),
      delayAmount?: string(name='DelayAmount', description='When Shutdown Policy is delayStop, this number refer to Shutdown-delay Credit (overdraft limit).', example='600'),
      delayStatus?: string(name='DelayStatus', description='There are a value for Shutdown Policy Management towards Sub Account.
- 1 immediatelyStop,  immediately shutdown the instance once customer\\\\"s quota is ran out.
- 2 delayStop, delay shutdown the instance until customer\\\\"s Shutdown-delay Credit is ran out. Please refer to DelayAmount.
- 3 noStop, customer\\\\"s instance status is rely on manual control instead of auto setting.', example='immediatelyStop'),
      email?: string(name='Email', description='The E-mail of Distribution Customer.', example='1234@qq.com'),
      mobile?: string(name='Mobile', description='The contact number of Distribution Customer.', example='13641588680'),
      newBuyStatus?: string(name='NewBuyStatus', description='Purchase Control, Value Range:
- Purchase Forbidden
- Normal (Purchase is allowed)', example='Normal'),
      registerCountryCode?: string(name='RegisterCountryCode', description='The Country Code where the customer\\\\"s account is registered.', example='CN'),
      remark?: string(name='Remark', description='Description of Distribution Customer.', example='Sub Account'),
      subAccountType?: int32(name='SubAccountType', description='Account Type:
- 1 Agency\\\\"s End User
- 2 Reseller\\\\"s End User
- 3 Enterprise
- 4 T2 Agency Partner
- 5 T2 Reseller Partner
- 6 T2 Agency+Reseller Partner', example='1'),
      uid?: long(name='Uid', description='Account UID of Distribution Customer.', example='1415740779475837'),
    }
  ](name='AccountInfo')
  }(name='AccountInfoList', description='List of Account Information'),
  code?: string(name='Code', description='Result Code - Error Code. Value Range:
- 200 OK
- 1109 System Error
- 3029: Invalid UID
- 3062: UID and UserType are both empty.
- 3063: UserType value out of range.', example='200'),
  message?: string(name='Message', description='message', example='success'),
  pageInfo?: {
    page?: int32(name='Page', description='Pagination, current page.', example='1'),
    pageSize?: int32(name='PageSize', description='Pagination, record number on each page.', example='10'),
    total?: int32(name='Total', description='Pagination, page volume in total.', example='12'),
  }(name='PageInfo', description='Pagination Information'),
  requestId?: string(name='RequestId', description='Request id, a unique identifier generated by Alibaba Cloud for the request.', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model GetAccountInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAccountInfoResponseBody(name='body'),
}

/**
 * @summary Return Distribution Customer\\"s account information.
 *
 * @param request GetAccountInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAccountInfoResponse
 */
async function getAccountInfoWithOptions(request: GetAccountInfoRequest, runtime: Util.RuntimeOptions): GetAccountInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAccountInfo',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Return Distribution Customer\\"s account information.
 *
 * @param request GetAccountInfoRequest
 * @return GetAccountInfoResponse
 */
async function getAccountInfo(request: GetAccountInfoRequest): GetAccountInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAccountInfoWithOptions(request, runtime);
}

model GetCouponTemplateDetailRequest {
  templateId?: long(name='TemplateId', description='This parameter is required.', example='5093156'),
}

model GetCouponTemplateDetailResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    applicableProducts?: string(name='ApplicableProducts', example='UNIVERSAL'),
    costBearer?: string(name='CostBearer', example='aliyun_poc'),
    couponDescription?: string(name='CouponDescription'),
    createdTime?: string(name='CreatedTime', example='2024-11-21 18:18:22'),
    denomination?: double(name='Denomination', example='100'),
    limitPerPerson?: int32(name='LimitPerPerson', example='1'),
    purchaseType?: string(name='PurchaseType', example='ALL,BILLING'),
    reasonForApplication?: string(name='ReasonForApplication'),
    status?: string(name='Status', example='APPROVED'),
    templateId?: long(name='TemplateId', example='1576'),
    templateName?: string(name='TemplateName'),
    validUntil?: string(name='ValidUntil', example='100'),
    validUntilType?: string(name='ValidUntilType', example='0'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', example='true'),
}

model GetCouponTemplateDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCouponTemplateDetailResponseBody(name='body'),
}

/**
 * @summary 查询优惠券模板详情
 *
 * @param request GetCouponTemplateDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCouponTemplateDetailResponse
 */
async function getCouponTemplateDetailWithOptions(request: GetCouponTemplateDetailRequest, runtime: Util.RuntimeOptions): GetCouponTemplateDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCouponTemplateDetail',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询优惠券模板详情
 *
 * @param request GetCouponTemplateDetailRequest
 * @return GetCouponTemplateDetailResponse
 */
async function getCouponTemplateDetail(request: GetCouponTemplateDetailRequest): GetCouponTemplateDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCouponTemplateDetailWithOptions(request, runtime);
}

model GetCoupondeductProductCodeRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='This parameter is required.', example='zh-CN'),
}

model GetCoupondeductProductCodeResponseBody = {
  code?: string(name='Code', example='code'),
  data?: [ 
    {
      productType?: any(name='ProductType', example='code1'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='Id of the request', example='210e876f16704666020714468dab35'),
  success?: boolean(name='Success', example='true'),
}

model GetCoupondeductProductCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCoupondeductProductCodeResponseBody(name='body'),
}

/**
 * @summary 国际渠道分销优惠券可抵扣产品
 *
 * @param request GetCoupondeductProductCodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCoupondeductProductCodeResponse
 */
async function getCoupondeductProductCodeWithOptions(request: GetCoupondeductProductCodeRequest, runtime: Util.RuntimeOptions): GetCoupondeductProductCodeResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCoupondeductProductCode',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 国际渠道分销优惠券可抵扣产品
 *
 * @param request GetCoupondeductProductCodeRequest
 * @return GetCoupondeductProductCodeResponse
 */
async function getCoupondeductProductCode(request: GetCoupondeductProductCodeRequest): GetCoupondeductProductCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCoupondeductProductCodeWithOptions(request, runtime);
}

model GetCreditInfoRequest {
  uid?: long(name='Uid', description='Sub Account UID

This parameter is required.', example='1792155717328010'),
}

model GetCreditInfoResponseBody = {
  code?: string(name='Code', description='Result Code:
- 200 OK
- 1109 System Error', example='200'),
  data?: {
    accountStatus?: string(name='AccountStatus', description='The Credit Control status, Value Range:</br>
1. normal - Sub Account status is running as usual.
2. arrearsNotShutdown - Sub Account status is running as usual, but have outstanding bill(s).
3. shutdown -  Sub Account status is down.', example='normal'),
    alarmThreshold?: string(name='AlarmThreshold', description='Percentage value, when the available credit limit is lower than this credit limit percentage, a notification E-mail will be sent to the main account.', example='20'),
    availableCredit?: string(name='AvailableCredit', description='The Credit available to consume.', example='800'),
    consumedUndeductedValue?: string(name='ConsumedUndeductedValue', description='Obtain total unpaid amount on demo bill before simulated deduction.', example='0.000000'),
    creditLine?: string(name='CreditLine', description='The Credit Line of Sub Account', example='1000'),
    outstandingBalance?: string(name='OutstandingBalance', description='The Credit have been consumed by Sub Account, and haven\\\\"t be paid.', example='200'),
    zeroCreditShutdownPolicy?: string(name='ZeroCreditShutdownPolicy', description='The systematic controlling policy for resource management, specifically when the available Credit of Sub Account falls to 0 or less.</br>

- 1: delayStop. The account have Shutdown-delay Privilege,  After Shutdown-delay Credit is ran out, Alibaba Cloud will take over resources and keep the instance for 15 days. In addition, the instance will be released if Sub Account failed to pay the bill within these 15 days.</br>
- 2: noStop. Partner will manually manage Shutdown Status for Sub Account. Meanwhile, System would not manage the resource\\\\"s life-circle of Sub Account.</br>
- 3: immediatelyStop. Once valid quota of Sub Account falls below 0 and be identified as defaulting account, it will trigger the instance shutdown immediately.</br>', example='delayStop'),
    newBuyStatus?: string(name='newBuyStatus', description='Manage order operation.
- ban：Ban the new purchase action.
- normal：The account could raise new purchase order as usual.', example='ban'),
  }(name='Data', description='The data returned.'),
  message?: string(name='Message', description='Message Information', example='success'),
  requestId?: string(name='RequestId', description='Request ID, Alibaba Cloud will track errors with this.', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model GetCreditInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCreditInfoResponseBody(name='body'),
}

/**
 * @summary Query Credit Control information of Distribution Customers. The PopCreditInfoJson in the Return Parameter will be empty if the Distribution Customer is an Agency. This function is only available for Resellers and Distributors.
 *
 * @param request GetCreditInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCreditInfoResponse
 */
async function getCreditInfoWithOptions(request: GetCreditInfoRequest, runtime: Util.RuntimeOptions): GetCreditInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCreditInfo',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Query Credit Control information of Distribution Customers. The PopCreditInfoJson in the Return Parameter will be empty if the Distribution Customer is an Agency. This function is only available for Resellers and Distributors.
 *
 * @param request GetCreditInfoRequest
 * @return GetCreditInfoResponse
 */
async function getCreditInfo(request: GetCreditInfoRequest): GetCreditInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCreditInfoWithOptions(request, runtime);
}

model GetCustomerOrdersRequest {
  customerAccount?: string(name='CustomerAccount', example='test_123'),
  customerManager?: string(name='CustomerManager', example='myBd'),
  customerUid?: long(name='CustomerUid', example='123456'),
  endDate?: string(name='EndDate', description='This parameter is required.', example='2024-08-23 00:00:00'),
  orderId?: long(name='OrderId', example='209335720330622'),
  orderSource?: int32(name='OrderSource', example='0'),
  orderStatus?: int32(name='OrderStatus', example='3'),
  orderType?: string(name='OrderType', example='RENEW'),
  pageNo?: int32(name='PageNo', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  productType?: string(name='ProductType', example='vm_intl'),
  startDate?: string(name='StartDate', description='This parameter is required.', example='2024-08-13 00:00:00'),
  timeType?: int32(name='TimeType', description='This parameter is required.', example='2'),
}

model GetCustomerOrdersResponseBody = {
  code?: string(name='Code', example='200'),
  data?: [ 
    {
      customerAccount?: string(name='CustomerAccount', example='test_123'),
      customerManager?: string(name='CustomerManager', example='myBd'),
      customerNo?: long(name='CustomerNo', example='123456'),
      orderId?: long(name='OrderId', example='236414227150922'),
      orderSource?: string(name='OrderSource', example='0'),
      orderStatus?: int32(name='OrderStatus', example='3'),
      orderType?: string(name='OrderType', example='BUY'),
      originalCost?: double(name='OriginalCost', example='3.92'),
      paymentMethod?: string(name='PaymentMethod', example='3:32'),
      paymentTime?: string(name='PaymentTime', example='2024-08-13 13:02:02'),
      pretaxCost?: double(name='PretaxCost', example='3.92'),
      productDetail?: string(name='ProductDetail', example='oss'),
      productType?: string(name='ProductType', example='snapshot'),
      timeToOrder?: string(name='TimeToOrder', example='2024-08-13 13:02:02'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  msg?: string(name='Msg'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='1'),
  requestId?: string(name='RequestId', description='Id of the request', example='23309219-4A34-589D-A3E0-9B2A3BFFD24F'),
  success?: boolean(name='Success', example='true'),
  total?: int32(name='Total', example='100'),
}

model GetCustomerOrdersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCustomerOrdersResponseBody(name='body'),
}

/**
 * @summary 客户订单查询
 *
 * @param request GetCustomerOrdersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCustomerOrdersResponse
 */
async function getCustomerOrdersWithOptions(request: GetCustomerOrdersRequest, runtime: Util.RuntimeOptions): GetCustomerOrdersResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCustomerOrders',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 客户订单查询
 *
 * @param request GetCustomerOrdersRequest
 * @return GetCustomerOrdersResponse
 */
async function getCustomerOrders(request: GetCustomerOrdersRequest): GetCustomerOrdersResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCustomerOrdersWithOptions(request, runtime);
}

model GetDailyBillRequest {
  billOwner?: string(name='BillOwner', description='Bill Owner type. Value Range:</br>
1: Master account</br>
2: Sub account</br>

This parameter is required.', example='1'),
  billType?: string(name='BillType', description='BillType. Value Range:</br>

- DailyOrder(Deprecated)
- DailyBill (Deprecated)
- DailyInstanceBill (Deprecated)
- DailyInstanceBillV2

This parameter is required.', example='DailyInstanceBillV2'),
  date?: string(name='Date', description='Billing date. Format YYYY-MM-DD

This parameter is required.', example='2022-11-24'),
}

model GetDailyBillResponseBody = {
  code?: string(name='Code', description='Result Code:
* 200 OK
* 1109 System error
* 3050 Bill Type can only be DailyOrder, DailyBill or DailyInstanceBill.
* 3049 Incorrect format of Spending Time.
* 3048 Bill Owner can only be 1 or 2.', example='200'),
  data?: {
    billLinkCSV?: string(name='BillLinkCSV', description='The link to download CSV file, please use HTTP Protocol.', example='intl-reseller-month-bill.oss-ap-southeast-1.aliyuncs.com/statements/month/dts/1064252248461886/202104/Month%20Billing%20Invoice%20202104.pdf?Expires=1671160973&OSSAccessKeyId=TMP.3KhvoD9pW264cPv8sYe8E2zJ5HLWmrijNHgKiKpXcy8yS472BcrvemgTfNrrXKu5fCCdbLr2XhmYAyYPmbCe8zJyEkmYzL&Signature=hns1PgiiYl1WdI%2FdiOqbEdsgmfI%3D'),
    billLinkXLSX?: string(name='BillLinkXLSX', description='The link to download XLSX file, please use HTTP Protocol.', example='intl-reseller-month-bill.oss-ap-southeast-1.aliyuncs.com/statements/month/dts/1064252248461886/202104/Month%20Billing%20Invoice%20202104.pdf?Expires=1671160973&OSSAccessKeyId=TMP.3KhvoD9pW264cPv8sYe8E2zJ5HLWmrijNHgKiKpXcy8yS472BcrvemgTfNrrXKu5fCCdbLr2XhmYAyYPmbCe8zJyEkmYzL&Signature=hns1PgiiYl1WdI%2FdiOqbEdsgmfI%3D'),
    billOwner?: string(name='BillOwner', description='Same as inserted parameter BillOwner.', example='1'),
    billType?: string(name='BillType', description='Same as inserted parameter BillType.', example='DailyInstanceBillV2'),
    spendingTime?: string(name='SpendingTime', description='Spending Time, refer to the exact time of costuming.', example='20221201'),
  }(name='Data', description='The returned data.'),
  message?: string(name='Message', description='Same as Code parameters.', example='200'),
  requestId?: string(name='RequestId', description='Request ID, the unique request identifier generated by Alibaba Cloud.', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model GetDailyBillResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDailyBillResponseBody(name='body'),
}

/**
 * @summary Issue Distributor\\"s daily Bill. This function is only available for Resellers and Distributors.
 *
 * @param request GetDailyBillRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDailyBillResponse
 */
async function getDailyBillWithOptions(request: GetDailyBillRequest, runtime: Util.RuntimeOptions): GetDailyBillResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.billOwner)) {
    query['BillOwner'] = request.billOwner;
  }
  if (!Util.isUnset(request.billType)) {
    query['BillType'] = request.billType;
  }
  if (!Util.isUnset(request.date)) {
    query['Date'] = request.date;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDailyBill',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Issue Distributor\\"s daily Bill. This function is only available for Resellers and Distributors.
 *
 * @param request GetDailyBillRequest
 * @return GetDailyBillResponse
 */
async function getDailyBill(request: GetDailyBillRequest): GetDailyBillResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDailyBillWithOptions(request, runtime);
}

model GetInviteStatusRequest {
  inviteStatusList?: [ 
    {
      inviteId?: long(name='InviteId', description='Invitation ID, From interface InviteSubAccount', example='123'),
    }
  ](name='InviteStatusList', description='inviteId list</br>
`Sub-levels <= 5`

This parameter is required.'),
}

model GetInviteStatusResponseBody = {
  code?: string(name='Code', description='Status Code. Error Code:

- 3057 InviteId is empty', example='200'),
  data?: {
    inviteStatus?: [ 
    {
      code?: string(name='Code', description='Result Code. Value Range:
*   200 OK
*   1109 system error', example='200'),
      inviteStatusList?: {
        associationSuccessTime?: string(name='AssociationSuccessTime', description='The time that Distribution Customer successfully associated with Distributor.</br>
This value will be empty if there is no existing association.', example='2018-02-13'),
        cid?: long(name='Cid', description='Distribution Customer\\\\"s CID', example='1234567890123'),
        gmtCreate?: string(name='GmtCreate', description='The time of email been sent out.', example='2018-02-12'),
        parentId?: string(name='ParentId', description='The parent organization ID.', example='1093238769140523'),
        status?: int32(name='Status', description='Invitation Status:
* 0 No visit on registration URL
* 1 Successful Registration
* 2 Unsuccessful Registration
* 3 Registration URL have been visited, but no submitted sheet/ticket.', example='2'),
        subAccountType?: string(name='SubAccountType', description='Account Type:
- 1 Agency\\\\"s End User
- 2 Reseller\\\\"s End User
- 5 T2 Reseller Partner', example='1'),
        uid?: long(name='Uid', description='Distribution Customer\\\\"s UID', example='1234567890123'),
      }(name='InviteStatusList', description='List of Invitation Status result'),
      message?: string(name='Message', description='The message returned.', example='success'),
      success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.', example='true'),
    }
  ](name='InviteStatus')
  }(name='Data', description='The returned data.'),
  message?: string(name='Message', description='The message returned.', example='success'),
  requestId?: string(name='RequestId', description='Request ID, Alibaba Cloud will track errors with this.', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model GetInviteStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInviteStatusResponseBody(name='body'),
}

/**
 * @summary Query invitation status of customer who have been created and invited.
 *
 * @param request GetInviteStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInviteStatusResponse
 */
async function getInviteStatusWithOptions(request: GetInviteStatusRequest, runtime: Util.RuntimeOptions): GetInviteStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.inviteStatusList)) {
    query['InviteStatusList'] = request.inviteStatusList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetInviteStatus',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Query invitation status of customer who have been created and invited.
 *
 * @param request GetInviteStatusRequest
 * @return GetInviteStatusResponse
 */
async function getInviteStatus(request: GetInviteStatusRequest): GetInviteStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInviteStatusWithOptions(request, runtime);
}

model GetMonthlyBillRequest {
  billOwner?: string(name='BillOwner', description='Bill Owner type. Value Range:</br>
1: Master account</br>
2: Sub account</br>

This parameter is required.', example='1'),
  billType?: string(name='BillType', description='Value Range:

- MonthlyInvoice
- MonthRefundInvoice
- MonthlySummary (Deprecated)
- MonthlyInstanceAddAdjustBill 
- MonthlyInstanceRefundBill
- MonthlyAddAdjustInvoce
- MonthlyRefundAdjustInvoce 
- MonthlyInstanceConsumeV2 
- MarginReportV2

This parameter is required.', example='MonthlyInvoice'),
  month?: string(name='Month', description='Billing Month, Format is YYYY-MM

This parameter is required.', example='2022-11'),
}

model GetMonthlyBillResponseBody = {
  code?: string(name='Code', description='Result Code:
* 200 OK
* 1109 System error
* 3030 Sub Account Nickname exceeds maximum length, maximum length 150 bytes.
* 3031 Remark exceeds maximum length, maximum length 3000 bytes.', example='200'),
  data?: {
    billLinkCSV?: string(name='BillLinkCSV', description='The link to download CSV file, please use HTTP Protocol.', example='intl-reseller-month-bill.oss-ap-southeast-1.aliyuncs.com/statements/month/dts/1064252248461886/202104/Month%20Billing%20Invoice%20202104.pdf?Expires=1671160973&OSSAccessKeyId=TMP.3KhvoD9pW264cPv8sYe8E2zJ5HLWmrijNHgKiKpXcy8yS472BcrvemgTfNrrXKu5fCCdbLr2XhmYAyYPmbCe8zJyEkmYzL&Signature=hns1PgiiYl1WdI%2FdiOqbEdsgmfI%3D'),
    billLinkXLSX?: string(name='BillLinkXLSX', description='The link to download XLSX file, please use HTTP Protocol.', example='intl-reseller-month-bill.oss-ap-southeast-1.aliyuncs.com/statements/month/dts/1064252248461886/202104/Month%20Billing%20Invoice%20202104.pdf?Expires=1671160973&OSSAccessKeyId=TMP.3KhvoD9pW264cPv8sYe8E2zJ5HLWmrijNHgKiKpXcy8yS472BcrvemgTfNrrXKu5fCCdbLr2XhmYAyYPmbCe8zJyEkmYzL&Signature=hns1PgiiYl1WdI%2FdiOqbEdsgmfI%3D'),
    billOwner?: string(name='BillOwner', description='Same as inserted parameter BillOwner.', example='1'),
    billType?: string(name='BillType', description='Same as inserted parameter BillType.', example='MonthlyInvoice'),
    invoiceLink?: string(name='InvoiceLink', description='The URL to download invoice.', example='intl-reseller-month-bill.oss-ap-southeast-1.aliyuncs.com/statements/month/dts/1064252248461886/202104/Month%20Billing%20Invoice%20202104.pdf?Expires=1671160973&OSSAccessKeyId=TMP.3KhvoD9pW264cPv8sYe8E2zJ5HLWmrijNHgKiKpXcy8yS472BcrvemgTfNrrXKu5fCCdbLr2XhmYAyYPmbCe8zJyEkmYzL&Signature=hns1PgiiYl1WdI%2FdiOqbEdsgmfI%3D'),
    refundInvoiceFlag?: boolean(name='RefundInvoiceFlag', description='It states the existence of refund invoice. </br>
Candidate Values: True/False', example='True'),
    refundInvoiceLink?: string(name='RefundInvoiceLink', description='The URL to download refund invoice.', example='intl-reseller-month-bill.oss-ap-southeast-1.aliyuncs.com/statements/month/dts/1064252248461886/202104/Month%20Billing%20Invoice%20202104.pdf?Expires=1671160973&OSSAccessKeyId=TMP.3KhvoD9pW264cPv8sYe8E2zJ5HLWmrijNHgKiKpXcy8yS472BcrvemgTfNrrXKu5fCCdbLr2XhmYAyYPmbCe8zJyEkmYzL&Signature=hns1PgiiYl1WdI%2FdiOqbEdsgmfI%3D'),
    spendingTime?: string(name='SpendingTime', description='Spending Time, refer to the exact time of costuming.', example='20221201'),
  }(name='Data', description='The returned data.'),
  message?: string(name='Message', description='Same as Code parameters.', example='200'),
  requestId?: string(name='RequestId', description='Request ID, the unique request identifier generated by Alibaba Cloud.', example='210e876f16704666020714468dab35'),
  success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model GetMonthlyBillResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMonthlyBillResponseBody(name='body'),
}

/**
 * @summary Issue Distributor\\"s Monthly Bill. This function is only available for Resellers and Distributors.
 *
 * @param request GetMonthlyBillRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMonthlyBillResponse
 */
async function getMonthlyBillWithOptions(request: GetMonthlyBillRequest, runtime: Util.RuntimeOptions): GetMonthlyBillResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.billOwner)) {
    query['BillOwner'] = request.billOwner;
  }
  if (!Util.isUnset(request.billType)) {
    query['BillType'] = request.billType;
  }
  if (!Util.isUnset(request.month)) {
    query['Month'] = request.month;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMonthlyBill',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Issue Distributor\\"s Monthly Bill. This function is only available for Resellers and Distributors.
 *
 * @param request GetMonthlyBillRequest
 * @return GetMonthlyBillResponse
 */
async function getMonthlyBill(request: GetMonthlyBillRequest): GetMonthlyBillResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMonthlyBillWithOptions(request, runtime);
}

model GetUnassociatedCustomerRequest {
  currentPage?: int32(name='CurrentPage', description='Pagination, current page.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='Pagination, record number on each page.

This parameter is required.', example='10'),
}

model GetUnassociatedCustomerResponseBody = {
  code?: string(name='Code', description='Error Code, Candidate Value：
* 200: OK
* 1109: System error', example='200'),
  inviteInfoList?: {
    inviteInfo?: [ 
    {
      accountNickname?: string(name='AccountNickname', description='The name of Customer who are to be invited.', example='My Client'),
      email?: string(name='Email', description='The Email of Customer who are to be invited.', example='12345@qq.com'),
      gmtCreate?: string(name='GmtCreate', description='The time of email been sent out.', example='2023-05-10'),
      inviteId?: long(name='InviteId', description='Invitation ID', example='190'),
      status?: int32(name='Status', description='Invitation Status:
* 0 No visit on registration URL
* 1 Successful Registration
* 2 Unsuccessful Registration
* 3 Registration URL have been visited, but no submitted sheet/ticket.', example='1'),
    }
  ](name='InviteInfo')
  }(name='InviteInfoList', description='List of Invitation Information'),
  message?: string(name='Message', description='Message information', example='success'),
  pageInfo?: {
    page?: int32(name='Page', description='Pagination, current page.', example='1'),
    pageSize?: int32(name='PageSize', description='Pagination, record number on each page.', example='10'),
    total?: int32(name='Total', description='Pagination, page volume in total.', example='12'),
  }(name='PageInfo', description='Pagination Information'),
  requestId?: string(name='RequestId', description='Request ID, Alibaba Cloud will track errors with this.', example='23309219-4A34-589D-A3E0-9B2A3BFFD24F'),
  success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model GetUnassociatedCustomerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUnassociatedCustomerResponseBody(name='body'),
}

/**
 * @summary Query all the Unassociated Customer.
 *
 * @param request GetUnassociatedCustomerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUnassociatedCustomerResponse
 */
async function getUnassociatedCustomerWithOptions(request: GetUnassociatedCustomerRequest, runtime: Util.RuntimeOptions): GetUnassociatedCustomerResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUnassociatedCustomer',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Query all the Unassociated Customer.
 *
 * @param request GetUnassociatedCustomerRequest
 * @return GetUnassociatedCustomerResponse
 */
async function getUnassociatedCustomer(request: GetUnassociatedCustomerRequest): GetUnassociatedCustomerResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUnassociatedCustomerWithOptions(request, runtime);
}

model InviteSubAccountRequest {
  accountInfoList?: [ 
    {
      accountNickname?: string(name='AccountNickname', description='The name of Sub Account:</br>
1. Use the official name of Company, if Sub Account is an enterprise.</br>
2. Use the official name of Partner, if Sub Account is a T2 reseller.</br>

This parameter is required.', example='XXX Technology LTD.'),
      creditLine?: string(name='CreditLine', description='The total budget Credit of Sub Account that distributed by Partner.

This parameter is required.', example='100'),
      customerBd?: string(name='CustomerBd'),
      customerId?: string(name='CustomerId', description='Customer ID, Returning ID from CreateCustomer API.

This parameter is required.', example='1234567'),
      emailAddress?: string(name='EmailAddress', description='The email address of End User,  which will receive the invitation email.

This parameter is required.', example='12345@163.com'),
      newBuyStatus?: string(name='NewBuyStatus', description='Initial Order Status</br>
1. ban：Ban the new purchase action--After End User finish registration and authorization, they can\\\\"t issue Cloud Resource order immediately. Partner should manually update the "Order Control" settings as "Normal" to enable new order.</br>
2. normal：Normal--After End User finished registration and authorization, they can issue Cloud Resource order immediately.</br>

This parameter is required.', example='ban'),
      remark?: string(name='Remark', description='Description of Sub Account.', example='The invitation to develop XX as a Sub Account'),
      subAccountType?: string(name='SubAccountType', description='The type of Sub Account</br>

1 Agency\\\\"s End User</br>
2 Reseller\\\\"s End user</br>
5 Reseller\\\\"s T2 Partner</br>

This parameter is required.', example='1'),
      zeroCreditShutdownPolicy?: string(name='ZeroCreditShutdownPolicy', description='Partner\\\\"s Shutdown Policy Management for Sub Account.</br>
1: delayStop. The account have Shutdown-delay Privilege,  After Shutdown-delay Credit is ran out, Alibaba Cloud will take over resources and keep the instance for 15 days. In addition, the instance will be released if Sub Account failed to pay the bill within these 15 days.</br>
2: noStop. Partner will manually manage Shutdown Status for Sub Account. Meanwhile, System would not manage the resource\\\\"s life-circle of Sub Account.</br>
3: immediatelyStop. Once valid quota of Sub Account falls below 0 and be identified as defaulting account, it will trigger the instance shutdown immediately.</br>

This parameter is required.', example='1'),
    }
  ](name='AccountInfoList', description='List of invited account information,  less than 5 accounts at a time.</br>
`Sub-levels <= 5`

This parameter is required.'),
}

model InviteSubAccountResponseBody = {
  code?: string(name='Code', description='Error Code: </br>
• 200 OK</br>
• 1109 System Error</br>', example='200'),
  message?: string(name='Message', description='Message</br>', example='success'),
  requestId?: string(name='RequestId', description='Request ID, Alibaba Cloud will track errors with this ID.', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  results?: {
    result?: [ 
    {
      code?: string(name='Code', description='Error Code, 200 OK', example='200'),
      message?: string(name='Message', description='Message, Notes of Code', example='success'),
      result?: {
        days?: int32(name='Days', description='Valid days of registration URL, count on daily basis.', example='15'),
        inviteId?: long(name='InviteId', description='Invitation ID, The invitation status tracking code.', example='12345'),
        regUrl?: string(name='RegUrl', description='URL for Partner Customer Registration.', example='http://agency-intl.console.aliyun.com/customer/register?intl=true&fxinfo=-4uT%2FMWHnnUdvr5GXVd1AYK8luTnGgH3M7Y3lSCd5M1fxRwAkViTWtDJDpckh0HL'),
      }(name='Result', description='Returning Message of Invitation Results'),
      success?: boolean(name='Success', description='Always true.', example='true'),
    }
  ](name='Result')
  }(name='Results', description='List of invitation sending results'),
  success?: boolean(name='Success', description='Candidate Values: True/False, this value states if the current API calling action is successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model InviteSubAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InviteSubAccountResponseBody(name='body'),
}

/**
 * @summary Initiate the Partner registration invitation.
 *
 * @description The current API request rate for the Cloud Product has not been disclosed.
 *
 * @param request InviteSubAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InviteSubAccountResponse
 */
async function inviteSubAccountWithOptions(request: InviteSubAccountRequest, runtime: Util.RuntimeOptions): InviteSubAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountInfoList)) {
    query['AccountInfoList'] = request.accountInfoList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'InviteSubAccount',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Initiate the Partner registration invitation.
 *
 * @description The current API request rate for the Cloud Product has not been disclosed.
 *
 * @param request InviteSubAccountRequest
 * @return InviteSubAccountResponse
 */
async function inviteSubAccount(request: InviteSubAccountRequest): InviteSubAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return inviteSubAccountWithOptions(request, runtime);
}

model IssueCouponForCustomerRequest {
  acceptLanguage?: string(name='AcceptLanguage', example='zh-CN'),
  couponTemplateId?: long(name='CouponTemplateId', description='This parameter is required.', example='5075915'),
  isUseBenefit?: boolean(name='IsUseBenefit'),
  uidlist?: string(name='Uidlist', description='This parameter is required.', example='111,2222'),
}

model IssueCouponForCustomerResponseBody = {
  code?: string(name='Code', example='code'),
  message?: string(name='Message', example='200'),
  requestId?: string(name='RequestId', description='Id of the request', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', example='true'),
  data?: {
    couponTemplateId?: long(name='CouponTemplateId', example='5075915'),
    createTime?: string(name='CreateTime', example='2024-03-05 18:24:07'),
    uidlist?: string(name='Uidlist', example='111,2222'),
  }(name='data'),
}

model IssueCouponForCustomerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: IssueCouponForCustomerResponseBody(name='body'),
}

/**
 * @summary 发放优惠券
 *
 * @param request IssueCouponForCustomerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return IssueCouponForCustomerResponse
 */
async function issueCouponForCustomerWithOptions(request: IssueCouponForCustomerRequest, runtime: Util.RuntimeOptions): IssueCouponForCustomerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.couponTemplateId)) {
    query['CouponTemplateId'] = request.couponTemplateId;
  }
  if (!Util.isUnset(request.isUseBenefit)) {
    query['IsUseBenefit'] = request.isUseBenefit;
  }
  if (!Util.isUnset(request.uidlist)) {
    query['Uidlist'] = request.uidlist;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'IssueCouponForCustomer',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 发放优惠券
 *
 * @param request IssueCouponForCustomerRequest
 * @return IssueCouponForCustomerResponse
 */
async function issueCouponForCustomer(request: IssueCouponForCustomerRequest): IssueCouponForCustomerResponse {
  var runtime = new Util.RuntimeOptions{};
  return issueCouponForCustomerWithOptions(request, runtime);
}

model ListCountriesResponseBody = {
  code?: string(name='Code', description='Error Code
* 200: OK
* 1109: System error', example='200'),
  data?: [ string ](name='Data', description='List of Region Code'),
  message?: string(name='Message', description='Message information', example='success'),
  requestId?: string(name='RequestId', description='Request ID, Alibaba Cloud will track errors with this.', example='A747A00F-E096-5244-88B3-3E474BAE3AE4'),
  success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model ListCountriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCountriesResponseBody(name='body'),
}

/**
 * @summary This function is available for all Distributors. It displays the corresponding region code information based on the operable countries as agreed in the Distributor\\"s contract.
 *
 * @description The current API request rate for cloud products has not been disclosed.
 *
 * @param request ListCountriesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCountriesResponse
 */
async function listCountriesWithOptions(runtime: Util.RuntimeOptions): ListCountriesResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListCountries',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary This function is available for all Distributors. It displays the corresponding region code information based on the operable countries as agreed in the Distributor\\"s contract.
 *
 * @description The current API request rate for cloud products has not been disclosed.
 *
 * @return ListCountriesResponse
 */
async function listCountries(): ListCountriesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCountriesWithOptions(runtime);
}

model ListCouponUsageRequest {
  account?: string(name='Account', example='oqevfbveuadcrduzmf@ttirv.net'),
  couponTemplateId?: long(name='CouponTemplateId', example='5075915'),
  page?: int32(name='Page', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  status?: string(name='Status', example='AVAILABLE'),
  uid?: long(name='Uid', example='1133166938931507'),
}

model ListCouponUsageResponseBody = {
  code?: string(name='Code', example='200'),
  data?: [ 
    {
      account?: string(name='Account', example='oqevfbveuadcrduzmf@ttirv.net'),
      amount?: double(name='Amount'),
      balance?: double(name='Balance', example='0.01'),
      couponId?: string(name='CouponId', example='59226280'),
      couponTemplateId?: long(name='CouponTemplateId', example='503802'),
      effDate?: string(name='EffDate', example='2023-04-06 00:00:00 ~ 2023-04-07 00:00:00'),
      publishDate?: string(name='PublishDate', example='2023-04-06 19:32:10'),
      status?: string(name='Status', example='AVAILABLE'),
      uid?: long(name='Uid', example='1647668856741998'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageInfo?: {
    page?: int32(name='Page', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    total?: int32(name='Total', example='300'),
  }(name='PageInfo'),
  requestId?: string(name='RequestId', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
}

model ListCouponUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCouponUsageResponseBody(name='body'),
}

/**
 * @summary 优惠券使用量列表查询
 *
 * @param request ListCouponUsageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCouponUsageResponse
 */
async function listCouponUsageWithOptions(request: ListCouponUsageRequest, runtime: Util.RuntimeOptions): ListCouponUsageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.account)) {
    query['Account'] = request.account;
  }
  if (!Util.isUnset(request.couponTemplateId)) {
    query['CouponTemplateId'] = request.couponTemplateId;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCouponUsage',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 优惠券使用量列表查询
 *
 * @param request ListCouponUsageRequest
 * @return ListCouponUsageResponse
 */
async function listCouponUsage(request: ListCouponUsageRequest): ListCouponUsageResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCouponUsageWithOptions(request, runtime);
}

model QuotaListExportPagedRequest {
  currentPage?: int32(name='CurrentPage', description='Pagination, current page number, starting from 1.

This parameter is required.', example='1'),
  language?: string(name='Language', description='Multilingual Parameters, the default language is English.</br>
en: English</br>
zh: Chinese</br>
ja: Japanese </br>', example='en'),
  pageSize?: int32(name='PageSize', description='Pagination, record number on each page, maximum 100.

This parameter is required.', example='10'),
}

model QuotaListExportPagedResponseBody = {
  code?: string(name='Code', description='Status code of returning result, 200 means success.', example='200'),
  data?: [ 
    {
      createTime?: string(name='CreateTime', description='Create Time', example='2023-12-21 21:31:57 UTC+8'),
      fileName?: string(name='FileName', description='File Name', example='5113766248601929_quota_2023-06-22_2023-12-21_all_2023122121310057'),
      message?: string(name='Message', description='Notification Message', example='success'),
      status?: string(name='Status', description='Display of Task Status', example='3'),
      statusCode?: string(name='StatusCode', description='Task Status Enum</br>
2: Exporting</br>
3: Export Success</br>
-1: Export Fail</br>', example='Export Success'),
      url?: string(name='Url', description='The link to download exported file.', example='//aliyun-eco-market-servic-singapore.oss-ap-southeast-1.aliyuncs.com/5113766248601929_quota_2023-06-22_2023-12-21_all_2023122121310057'),
    }
  ](name='Data', description='Listed data of returning result'),
  msg?: string(name='Msg', description='Description of returning result', example='SUCCESS'),
  pageNo?: int32(name='PageNo', description='Current page number', example='1'),
  pageSize?: int32(name='PageSize', description='Record number on each page', example='10'),
  requestId?: string(name='RequestId', description='ID of the Request', example='210e876f16704666020714468dab35'),
  total?: int32(name='Total', description='Total volume', example='10'),
}

model QuotaListExportPagedResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuotaListExportPagedResponseBody(name='body'),
}

/**
 * @summary Check the result of export quota list as a Distribution Customer from International Site. Only available on International Site.
 *
 * @description Caller must be a Partner from International Site, either Distribution or Reseller will do.
 *
 * @param request QuotaListExportPagedRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QuotaListExportPagedResponse
 */
async function quotaListExportPagedWithOptions(request: QuotaListExportPagedRequest, runtime: Util.RuntimeOptions): QuotaListExportPagedResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QuotaListExportPaged',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Check the result of export quota list as a Distribution Customer from International Site. Only available on International Site.
 *
 * @description Caller must be a Partner from International Site, either Distribution or Reseller will do.
 *
 * @param request QuotaListExportPagedRequest
 * @return QuotaListExportPagedResponse
 */
async function quotaListExportPaged(request: QuotaListExportPagedRequest): QuotaListExportPagedResponse {
  var runtime = new Util.RuntimeOptions{};
  return quotaListExportPagedWithOptions(request, runtime);
}

model ResendEmailRequest {
  inviteId?: long(name='InviteId', description='Invitation ID, from interface InviteSubAccount </br>
Note: This field type is Long, which may result in precision loss in serialization/deserialization process. Please ensure the value does not exceed 9007199254740991.

This parameter is required.', example='176'),
}

model ResendEmailResponseBody = {
  code?: string(name='Code', description='Result Code, Error code.</br>
Candidate Value: </br>
* 200: OK
* 1109: System error
* 3058: Frequent sending, the limit is 10 emails in every 5 minutes.
* 3057: InviteId is empty.
* 3060: Can\\\\"t find sending record of given InviteId.
* 3061: Registration URL is expired, unable to resend.', example='200'),
  message?: string(name='Message', description='Result message', example='success'),
  requestId?: string(name='RequestId', description='Request ID, the unique request identifier generated by Alibaba Cloud.', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model ResendEmailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResendEmailResponseBody(name='body'),
}

/**
 * @summary Resend invitation email.
 *
 * @param request ResendEmailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResendEmailResponse
 */
async function resendEmailWithOptions(request: ResendEmailRequest, runtime: Util.RuntimeOptions): ResendEmailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.inviteId)) {
    query['InviteId'] = request.inviteId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResendEmail',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Resend invitation email.
 *
 * @param request ResendEmailRequest
 * @return ResendEmailResponse
 */
async function resendEmail(request: ResendEmailRequest): ResendEmailResponse {
  var runtime = new Util.RuntimeOptions{};
  return resendEmailWithOptions(request, runtime);
}

model SetAccountInfoRequest {
  accountNickname?: string(name='AccountNickname', description='Result Code:
*   200 OK
*   1109 System error
*   3030 Sub Account Nickname exceeds maximum length,  maximum length 150 bytes.
*   3031 Remark exceeds maximum length,  maximum length 3000 bytes.', example='Message information'),
  customerBd?: string(name='CustomerBd', description='Customer manager（limited 50 character）', example='abc'),
  remark?: string(name='Remark', description='success', example='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.'),
  uid?: long(name='Uid', description='Request ID, Alibaba Cloud will track errors with this.

This parameter is required.', example='1133166938931507'),
}

model SetAccountInfoResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', example='true'),
}

model SetAccountInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetAccountInfoResponseBody(name='body'),
}

/**
 * @summary This function is designed for Sub Account information maintenance, including Nickname and Remark.
 *
 * @param request SetAccountInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetAccountInfoResponse
 */
async function setAccountInfoWithOptions(request: SetAccountInfoRequest, runtime: Util.RuntimeOptions): SetAccountInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountNickname)) {
    query['AccountNickname'] = request.accountNickname;
  }
  if (!Util.isUnset(request.customerBd)) {
    query['CustomerBd'] = request.customerBd;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetAccountInfo',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary This function is designed for Sub Account information maintenance, including Nickname and Remark.
 *
 * @param request SetAccountInfoRequest
 * @return SetAccountInfoResponse
 */
async function setAccountInfo(request: SetAccountInfoRequest): SetAccountInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAccountInfoWithOptions(request, runtime);
}

model SetCreditLineRequest {
  creditLine?: string(name='CreditLine', description='New Credit Line

This parameter is required.', example='100'),
  uid?: long(name='Uid', description='The UID of Sub Account.

This parameter is required.', example='1263644979775567'),
}

model SetCreditLineResponseBody = {
  code?: string(name='Code', description='Result Code:
*   200 OK
*   1109 system error
*   3040 Sub Account is in a frozen state and cannot be operated.
*   3041 Credit is not a proper number', example='200'),
  message?: string(name='Message', description='Same as Code parameter value', example='200'),
  requestId?: string(name='RequestId', description='Request ID, the unique request identifier generated by Alibaba Cloud.', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', description='Candidate Value: True/False, which indicates whether the current API call itself is successful. It does not guarantee the success of subsequent business operations.', example='true'),
}

model SetCreditLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetCreditLineResponseBody(name='body'),
}

/**
 * @summary Set Credit Line for Distribution Customers. This function is only available for Resellers and Distributors.
 *
 * @param request SetCreditLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetCreditLineResponse
 */
async function setCreditLineWithOptions(request: SetCreditLineRequest, runtime: Util.RuntimeOptions): SetCreditLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.creditLine)) {
    query['CreditLine'] = request.creditLine;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetCreditLine',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Set Credit Line for Distribution Customers. This function is only available for Resellers and Distributors.
 *
 * @param request SetCreditLineRequest
 * @return SetCreditLineResponse
 */
async function setCreditLine(request: SetCreditLineRequest): SetCreditLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return setCreditLineWithOptions(request, runtime);
}

model SetWarningThresholdRequest {
  uid?: long(name='Uid', description='The UID of the partner‘s customer.

This parameter is required.', example='1792155717328010'),
  warningValue?: string(name='WarningValue', description='Percentage, 1 to 100. When the available credit limit is lower than the credit limit percentage, an email is sent to the main account.

This parameter is required.', example='20'),
}

model SetWarningThresholdResponseBody = {
  code?: string(name='Code', description='Result Code:
* 200 OK
* 1109 System Error
* 3040 The Sub Account is frozen, the operation cannot be completed. 
* 3044 Alert proportion value is not a number.
* 3045 Alert proportion value should between 1 to 100.', example='200'),
  message?: string(name='Message', description='Same as Code parameter value', example='200'),
  requestId?: string(name='RequestId', description='Request ID, the unique request identifier generated by Alibaba Cloud.', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', description='Candidate Value: True or False, which indicates whether the current API call itself is successful. does not represent the success of subsequent business operations.', example='true'),
}

model SetWarningThresholdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetWarningThresholdResponseBody(name='body'),
}

/**
 * @summary You can use this API to set the threshold for the use of credit control. When the customer credit control reaches below the threshold, it will pass through the notification email distributor. This feature is for Reseller and Distributor only.
 *
 * @param request SetWarningThresholdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetWarningThresholdResponse
 */
async function setWarningThresholdWithOptions(request: SetWarningThresholdRequest, runtime: Util.RuntimeOptions): SetWarningThresholdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  if (!Util.isUnset(request.warningValue)) {
    query['WarningValue'] = request.warningValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetWarningThreshold',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can use this API to set the threshold for the use of credit control. When the customer credit control reaches below the threshold, it will pass through the notification email distributor. This feature is for Reseller and Distributor only.
 *
 * @param request SetWarningThresholdRequest
 * @return SetWarningThresholdResponse
 */
async function setWarningThreshold(request: SetWarningThresholdRequest): SetWarningThresholdResponse {
  var runtime = new Util.RuntimeOptions{};
  return setWarningThresholdWithOptions(request, runtime);
}

model SubscriptionBillRequest {
  beginBillingCycle?: string(name='BeginBillingCycle', description='The start month from which the bills are pushed. Specify the value in the yyyy-MM format.

After the subscription is generated, the system automatically pushes the bill data that is generated from the month that you specified to the current point in time. Data of up to six months can be pushed. The current month is included. If you subscribe to the bills for more than six months, the subscription is invalid.

This parameter is required.', example='2022-10'),
  billFormat?: string(name='BillFormat', description='The file format of the bill. Valid values: csv and parquet.

If you subscribe to the bills of multiple file formats, we recommend that you store the bills in different OSS buckets to prevent file overwriting.

This parameter is required.', example='csv'),
  bucketOwnerId?: long(name='BucketOwnerId', description='The ID of the user to which the OSS bucket belongs.

If you are an eco-partner of Alibaba Cloud and you need to push the bills to the OSS bucket of a subordinate partner account, you must set this parameter to the ID of the subordinate partner account and grant the [AliyunConsumeDump2OSSRole](https://ram.console.aliyun.com/?spm=api-workbench.API%20Document.0.0.68c71e0fhmTSJp#/role/authorize?request=%7B%22Requests%22:%20%7B%22request1%22:%20%7B%22RoleName%22:%20%22AliyunConsumeDump2OSSRole%22,%20%22TemplateId%22:%20%22Dump2OSSRole%22%7D%7D,%20%22ReturnUrl%22:%20%22https:%2F%2Fusercenter2.aliyun.com%22,%20%22Service%22:%20%22Consume%22%7D) permission to the subordinate partner account.

If you are an eco-partner of Alibaba Cloud and you need to push the bills to the OSS bucket of your own account, your account must be granted the [AliyunConsumeDump2OSSRole](https://ram.console.aliyun.com/?spm=api-workbench.API%20Document.0.0.68c71e0fhmTSJp#/role/authorize?request=%7B%22Requests%22:%20%7B%22request1%22:%20%7B%22RoleName%22:%20%22AliyunConsumeDump2OSSRole%22,%20%22TemplateId%22:%20%22Dump2OSSRole%22%7D%7D,%20%22ReturnUrl%22:%20%22https:%2F%2Fusercenter2.aliyun.com%22,%20%22Service%22:%20%22Consume%22%7D) permission.

This parameter is required.', example='5569414254138836'),
  subscribeBucket?: string(name='SubscribeBucket', description='The name of the Object Storage Service (OSS) bucket in which you want to store the bills.

This parameter is required.', example='bill-bucket'),
  subscribeSegmentSize?: int32(name='SubscribeSegmentSize', description='The maximum rows in a single bill file. If the number of bill rows exceed the upper limit, the bill is automatically split into multiple files. The name of each split file is in the `uid_billType_billCycle_SquenceNo_fileNo` format.

Files whose names are the same except for the fileNo field are of the same type and belong to the same billing cycle.', example='100000'),
  subscribeType?: string(name='SubscribeType', description='The type of the bill to which you want to subscribe. Valid values: PartnerBillingItemDetailForBillingPeriod, PartnerBillingItemDetailMonthly, PartnerInstanceDetailForBillingPeriod, and PartnerInstanceDetailMonthly.

This parameter is required.', example='PartnerBillingItemDetailForBillingPeriod'),
}

model SubscriptionBillResponseBody = {
  code?: string(name='Code', description='The HTTP status code that is returned.', example='200'),
  data?: boolean(name='Data', description='The data that is returned.', example='true'),
  message?: string(name='Message', description='The message that is returned.', example='Successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9C14ADFE-DF0A-54D4-8BD5-45D0839246B4'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model SubscriptionBillResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubscriptionBillResponseBody(name='body'),
}

/**
 * @summary Generates the subscription to multi-level bills as an Alibaba Cloud eco-partner.
 *
 * @description *   Make sure that you are a distributor of the Alibaba Cloud international ecosystem.
 * *   You can call this operation to subscribe to only one type of bill at a time.
 * *   After the subscription to a type of bill is generated, the bill for the previous day is pushed on a daily basis from the next day. On the fifth day of each month, the full-data bill for the previous month is pushed.
 * *   A daily bill may be delayed. The delayed bill is pushed the next day after it is generated. The delayed bill may contain the bill data that is delayed until the previous day. We recommend that you query the full-data bill for the previous month at the beginning of each month.
 * *   Your account must be granted the [AliyunConsumeDump2OSSRole](https://ram.console.aliyun.com/?spm=api-workbench.API%20Document.0.0.68c71e0fhmTSJp#/role/authorize?request=%7B%22Requests%22:%20%7B%22request1%22:%20%7B%22RoleName%22:%20%22AliyunConsumeDump2OSSRole%22,%20%22TemplateId%22:%20%22Dump2OSSRole%22%7D%7D,%20%22ReturnUrl%22:%20%22https:%2F%2Fusercenter2.aliyun.com%22,%20%22Service%22:%20%22Consume%22%7D) permission.
 * *   The following file name formats are supported for bills:
 * ```
 * BillingItemDetailForBillingPeriod
 *   
 * File name format of a daily bill: UID_PartnerBillingItemDetail_YYYYMMDD_SquenceNo_fileNo. Example: 169**_BillingItemDetail_20190310_0001_01. 
 *   
 * File name format of a monthly full-data bill: UID_PartnerBillingItemDetail_YYYYMM_SquenceNo_fileNo. Example: 169**_BillingItemDetail_201903_0001_01. 
 * InstanceDetailForBillingPeriod
 *  
 *  File name format of a daily bill: UID_PartnerInstanceDetail_YYYYMMDD_SquenceNo_fileNo. Example: 169**_InstanceDetail_20190310_0001_01. 
 *   
 * File name format of a monthly full-data bill: UID_PartnerInstanceDetail_YYYYMM_SquenceNo_fileNo. Example: 169**_InstanceDetail_201903_1999-0001_01. 
 * BillingItemDetailMonthly
 *   
 * File name format of a daily bill: UID_PartnerBillingItemDetailMonthly_YYYYMM_SquenceNo_fileNo. Example: 169**_BillingItemDetailMonthly_201903_0001_01. This bill contains the bill data that is generated from the beginning of the current month to the fifth day of the next month. 
 * InstanceDetailMonthly
 *   
 * File name format of a daily bill: UID_PartnerInstanceDetailMonthly_YYYYMM_SquenceNo_fileNo. Example: 169**_InstanceDetailMonthly_201903_0001_01. This bill contains the bill data that is generated from the beginning of the current month to the fifth day of the next month. 
 * The fileNo field exists only when the number of bill rows reaches the maximum rows in a single bill file and the bill is split into multiple files.
 * ```
 * **This topic is published only on the international site (alibabacloud.com).
 *
 * @param request SubscriptionBillRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubscriptionBillResponse
 */
async function subscriptionBillWithOptions(request: SubscriptionBillRequest, runtime: Util.RuntimeOptions): SubscriptionBillResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginBillingCycle)) {
    query['BeginBillingCycle'] = request.beginBillingCycle;
  }
  if (!Util.isUnset(request.billFormat)) {
    query['BillFormat'] = request.billFormat;
  }
  if (!Util.isUnset(request.bucketOwnerId)) {
    query['BucketOwnerId'] = request.bucketOwnerId;
  }
  if (!Util.isUnset(request.subscribeBucket)) {
    query['SubscribeBucket'] = request.subscribeBucket;
  }
  if (!Util.isUnset(request.subscribeSegmentSize)) {
    query['SubscribeSegmentSize'] = request.subscribeSegmentSize;
  }
  if (!Util.isUnset(request.subscribeType)) {
    query['SubscribeType'] = request.subscribeType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubscriptionBill',
    version = '2022-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Generates the subscription to multi-level bills as an Alibaba Cloud eco-partner.
 *
 * @description *   Make sure that you are a distributor of the Alibaba Cloud international ecosystem.
 * *   You can call this operation to subscribe to only one type of bill at a time.
 * *   After the subscription to a type of bill is generated, the bill for the previous day is pushed on a daily basis from the next day. On the fifth day of each month, the full-data bill for the previous month is pushed.
 * *   A daily bill may be delayed. The delayed bill is pushed the next day after it is generated. The delayed bill may contain the bill data that is delayed until the previous day. We recommend that you query the full-data bill for the previous month at the beginning of each month.
 * *   Your account must be granted the [AliyunConsumeDump2OSSRole](https://ram.console.aliyun.com/?spm=api-workbench.API%20Document.0.0.68c71e0fhmTSJp#/role/authorize?request=%7B%22Requests%22:%20%7B%22request1%22:%20%7B%22RoleName%22:%20%22AliyunConsumeDump2OSSRole%22,%20%22TemplateId%22:%20%22Dump2OSSRole%22%7D%7D,%20%22ReturnUrl%22:%20%22https:%2F%2Fusercenter2.aliyun.com%22,%20%22Service%22:%20%22Consume%22%7D) permission.
 * *   The following file name formats are supported for bills:
 * ```
 * BillingItemDetailForBillingPeriod
 *   
 * File name format of a daily bill: UID_PartnerBillingItemDetail_YYYYMMDD_SquenceNo_fileNo. Example: 169**_BillingItemDetail_20190310_0001_01. 
 *   
 * File name format of a monthly full-data bill: UID_PartnerBillingItemDetail_YYYYMM_SquenceNo_fileNo. Example: 169**_BillingItemDetail_201903_0001_01. 
 * InstanceDetailForBillingPeriod
 *  
 *  File name format of a daily bill: UID_PartnerInstanceDetail_YYYYMMDD_SquenceNo_fileNo. Example: 169**_InstanceDetail_20190310_0001_01. 
 *   
 * File name format of a monthly full-data bill: UID_PartnerInstanceDetail_YYYYMM_SquenceNo_fileNo. Example: 169**_InstanceDetail_201903_1999-0001_01. 
 * BillingItemDetailMonthly
 *   
 * File name format of a daily bill: UID_PartnerBillingItemDetailMonthly_YYYYMM_SquenceNo_fileNo. Example: 169**_BillingItemDetailMonthly_201903_0001_01. This bill contains the bill data that is generated from the beginning of the current month to the fifth day of the next month. 
 * InstanceDetailMonthly
 *   
 * File name format of a daily bill: UID_PartnerInstanceDetailMonthly_YYYYMM_SquenceNo_fileNo. Example: 169**_InstanceDetailMonthly_201903_0001_01. This bill contains the bill data that is generated from the beginning of the current month to the fifth day of the next month. 
 * The fileNo field exists only when the number of bill rows reaches the maximum rows in a single bill file and the bill is split into multiple files.
 * ```
 * **This topic is published only on the international site (alibabacloud.com).
 *
 * @param request SubscriptionBillRequest
 * @return SubscriptionBillResponse
 */
async function subscriptionBill(request: SubscriptionBillRequest): SubscriptionBillResponse {
  var runtime = new Util.RuntimeOptions{};
  return subscriptionBillWithOptions(request, runtime);
}

